/**
 * <p>Copyright (c) 2017 深圳市鹏途交通科技有限公司 </p>
 * <p>				   All right reserved. 		     </p>
 * 
 * <p>项目名称 ： 	深圳市国省检日常化监管系统         </p>
 * <p>创建者   :	hey 
 * 
 * <p>描   述  :   TunnelRecord.java for com.pengtu.gsj.entity.yh    </p>
 * 
 * <p>最后修改 : $: Sep 18, 2017-2:11:40 PM v 1.0.0	 hey   $ </p>
 * 
*/

package com.pengtu.gsj.entity.yh;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

/**
 * 
 * TunnelRecord
 * 
 * Sep 18, 2017 2:11:40 PM
 * 
 * @version 1.0.0
 * 
 */
@Entity
@Table(name="T_YH_TUNNELRECORD")
public class TunnelRecord extends IdEntity {

	private static final long serialVersionUID = -8194518229993058918L;
	
	
	private String testYear;					//检查时间
	private Integer sumTunnel;					//隧道总数
	private Integer checkTunnel;				//排除出隐患的隧道数量
	private Integer governTunnel;				//治理后的隐患隧道数量
	private Double governPate;					//治理比例
	private String remark;
	
	private Integer bulletinNumber;   //培训文件数
	private List<Attachment> attachments;
	
	@Column(name = "TESTYEAR")
	public String getTestYear() {
		return testYear;
	}
	public void setTestYear(String testYear) {
		this.testYear = testYear;
	}
	@Column(name = "SUMTUNNEL")
	public Integer getSumTunnel() {
		return sumTunnel;
	}
	public void setSumTunnel(Integer sumTunnel) {
		this.sumTunnel = sumTunnel;
	}
	@Column(name = "CHECKTUNNEL")
	public Integer getCheckTunnel() {
		return checkTunnel;
	}
	public void setCheckTunnel(Integer checkTunnel) {
		this.checkTunnel = checkTunnel;
	}
	@Column(name = "GOVERNTUNNEL")
	public Integer getGovernTunnel() {
		return governTunnel;
	}
	public void setGovernTunnel(Integer governTunnel) {
		this.governTunnel = governTunnel;
	}
	@Column(name = "GOVERNPATE")
	public Double getGovernPate() {
		return governPate;
	}
	public void setGovernPate(Double governPate) {
		this.governPate = governPate;
	}
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	
	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
	
}
